#include <bits/stdc++.h>
using namespace std;
double eps = 1e-7;
const int N = 15;


int n;
double a[N][N];

double t[N];

bool zero(double x)
{
	return fabs(x) < eps;
}

void guass()
{
	for(int i = 1;i <= n;i ++)
	{
		int aim = i;
		for(int j = 1;j <= n;j ++)
		{
			if(j < i && !zero(a[j][j])) continue;
			if(fabs(a[j][i]) > fabs(a[aim][i])) aim = j;
		}
		if(zero(a[aim][i])) continue;
		for(int j = 1;j <= n + 1;j ++) swap(a[i][j], a[aim][j]);
		for(int j = n + 1;j >= i;j --) a[i][j] /= a[i][i];
		for(int j = 1;j <= n;j ++)
		{
			if(j == i) continue;
			double t = a[j][i];
			for(int k = i;k <= n + 1;k ++) a[j][k] -= t * a[i][k];
		}
	}
}

int main()
{
	cin >> n;
	for(int i = 1;i <= n;i ++) cin >> t[i];
	for(int i = 1;i <= n;i ++)
	{
		for(int j = 1;j <= n;j ++)
		{
			double b; cin >> b;
			a[i][j] = 2 * b - 2 * t[j];
			a[i][n + 1] += b * b - t[j] * t[j];
		}
	}
	guass();
	for(int i = 1;i <= n;i ++) printf("%.3lf ", a[i][n + 1]);
	cout << endl;
	return 0;
}